home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / frasr182.zip / FRACTALP.C < prev    next >
C/C++ Source or Header  |  1993-07-12  |  50KB  |  1,038 lines

  1. /*
  2.     This module consists only of the fractalspecific structure
  3.     and a *slew* of defines needed to get it to compile
  4. */
  5.  
  6. /* includes needed for fractalspecific */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include "fractint.h"
  11. #include "mpmath.h"
  12. #include "helpdefs.h"
  13. #include "fractype.h"
  14. #include "prototyp.h"
  15.  
  16. /* functions defined elswhere needed for fractalspecific */
  17. /* moved to prototyp.h */
  18.  
  19. /* parameter descriptions */
  20. /* Note: parameters preceded by + are integer parameters */
  21.  
  22. /* for Mandelbrots */
  23. static char realz0[] = "Real Perturbation of Z(0)";
  24. static char imagz0[] = "Imaginary Perturbation of Z(0)";
  25.  
  26. /* for Julias */
  27. static char realparm[] = "Real Part of Parameter";
  28. static char imagparm[] = "Imaginary Part of Parameter";
  29.  
  30. /* for Newtons */
  31. static char newtdegree[] = "+Polynomial Degree (>= 2)";
  32.  
  33. /* for MarksMandel/Julia */
  34. static char exponent[]   = "Real part of Exponent";
  35. static char imexponent[] = "Imag part of Exponent";
  36.  
  37. /* for Complex Newton */
  38. static char realroot[]     = "Real part of Root";
  39. static char imagroot[]     = "Imag part of Root";
  40. static char realdegree[] = "Real part of Degree";
  41. static char imagdegree[] = "Imag part of Degree";
  42.  
  43. /* for Lorenz */
  44. static char timestep[]       = "Time Step";
  45.  
  46. /* for formula */
  47. static char p1real[] = "Real portion of p1";
  48. static char p2real[] = "Real portion of p2";
  49. static char p1imag[] = "Imaginary portion of p1";
  50. static char p2imag[] = "Imaginary portion of p2";
  51.  
  52. /* trig functions */
  53. static char recoeftrg1[] = "Real Coefficient First Function";
  54. static char imcoeftrg1[] = "Imag Coefficient First Function";
  55. static char recoeftrg2[] = "Real Coefficient Second Function";
  56. static char imcoeftrg2[] = "Imag Coefficient Second Function";
  57.  
  58. /* MCP 7-7-91
  59. static char recoefsqr[] = "Real Coefficient Square Term";
  60. static char imcoefsqr[] = "Imag Coefficient Square Term";
  61. */
  62.  
  63. static char recoef2nd[] = "Real Coefficient Second Term";
  64. static char imcoef2nd[] = "Imag Coefficient Second Term";
  65.  
  66. /* KAM Torus */
  67. static char kamangle[] = "Angle (radians)";
  68. static char kamstep[] =  "Step size";
  69. static char kamstop[] =  "Stop value";
  70. static char pointsperorbit[] = "+Points per orbit";
  71.  
  72. /* Newtbasin */
  73. static char stripes[] = "Enter non-zero value for stripes";
  74.  
  75. /* Gingerbreadman */
  76. static char initx[] = "Initial x";
  77. static char inity[] = "Initial y";
  78.  
  79. /* popcorn */
  80. static char step[] = "Step size";
  81.  
  82. /* bifurcations */
  83. static char filt[] = "+Filter Cycles";
  84. static char seed[] = "Seed Population";
  85.  
  86. /* frothy basins */
  87. static char frothattractor[] = "+3 or 6 attractor system";
  88. static char frothshade[] =  "+Enter non-zero value for alternate color shading";
  89.  
  90. /* symmetrical icon fractals */
  91. static char lambda[] = "Lambda";
  92. static char alpha[]  = "Alpha";
  93. static char beta[]   = "Beta";
  94. static char gamma2[]  = "Gamma";
  95. static char omega[]  = "Omega";
  96. static char symdegree[] = "+Degree of symmetry";
  97.  
  98. static char shiftval[] = "Function Shift Value";
  99.  
  100. /* ifs */
  101. static char color_method[] = "+Coloring method (0,1)";
  102.  
  103. /* orbit fractals */
  104. static char A[] = "a";
  105. static char B[] = "b";
  106. static char D[] = "d";
  107.  
  108. /* 4D fractals */
  109. static char C[] = "c";
  110. static char C1[] = "c1";
  111. static char CI[] = "ci";
  112. static char CJ[] = "cj";
  113. static char CK[] = "ck";
  114. static char ZJ[] = "zj";
  115. static char ZK[] = "zk";
  116.  
  117. /* empty string */
  118. static char ES[] = "";
  119.  
  120. /* bailout defines */
  121. #define FTRIGBAILOUT 2500.0
  122. #define LTRIGBAILOUT   64.0
  123. #define FROTHBAILOUT    6.0
  124. #define STDBAILOUT    4.0
  125. #define NOBAILOUT    0.0
  126.  
  127. struct moreparams far moreparams[] = 
  128. {
  129.     ICON,  omega,symdegree,ES,ES,ES,ES,0,3,0,0,0,0,
  130.     ICON3D,omega,symdegree,ES,ES,ES,ES,0,3,0,0,0,0,
  131.     HYPERCMPLXJFP,ZJ,ZK,   ES,ES,ES,ES,0,0,0,0,0,0,
  132.     QUATJULFP    ,ZJ,ZK,   ES,ES,ES,ES,0,0,0,0,0,0,   
  133.     -1,      NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0
  134. };         
  135.  
  136.  
  137. struct fractalspecificstuff far fractalspecific[] =
  138. {
  139.    /*
  140.      fractal name, parameter text strings, parameter values,
  141.      helptext, helpformula, flags,
  142.      xmin  xmax  ymin  ymax int tojulia   tomandel tofloat  symmetry
  143.    |------|-----|-----|-----|--|--------|---------|--------|---------|
  144.      orbit fnct     per_pixel fnct  per_image fnct  calctype fcnt    bailout
  145.    |---------------|---------------|---------------|----------------|-------|
  146.    */
  147.  
  148.    "mandel", realz0, imagz0,ES,ES,0,0,0,0,
  149.    HT_MANDEL, HF_MANDEL, WINFRAC,
  150.    -2.5,  1.5, -1.5,  1.5, 1, JULIA, NOFRACTAL, MANDELFP, XAXIS_NOPARM,
  151.    JuliaFractal, mandel_per_pixel,MandelSetup, StandardFractal, STDBAILOUT,
  152.  
  153.    "julia", realparm, imagparm,ES,ES,0.3,0.6,0,0,
  154.    HT_JULIA, HF_JULIA, WINFRAC+OKJB,
  155.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, MANDEL, JULIAFP,  ORIGIN,
  156.    JuliaFractal, julia_per_pixel, JuliaSetup, StandardFractal, STDBAILOUT,
  157.  
  158.    "*newtbasin", newtdegree,stripes, ES,ES,3,0,0,0,
  159.    HT_NEWTBAS, HF_NEWTBAS, WINFRAC,
  160.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTBASIN,   NOSYM,
  161.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  162.  
  163.    "lambda",      realparm, imagparm,ES,ES,0.85,0.6,0,0,
  164.    HT_LAMBDA, HF_LAMBDA, WINFRAC+OKJB,
  165.    -1.5,  2.5, -1.5,  1.5, 1, NOFRACTAL, MANDELLAMBDA, LAMBDAFP,  NOSYM,
  166.    LambdaFractal,   julia_per_pixel, JulialongSetup,  StandardFractal,STDBAILOUT,
  167.  
  168.    "*mandel",    realz0, imagz0,ES,ES,0,0,0,0,
  169.    HT_MANDEL, HF_MANDEL, WINFRAC,
  170.    -2.5,  1.5, -1.5,  1.5, 0, JULIAFP,   NOFRACTAL, MANDEL,  XAXIS_NOPARM,
  171.    JuliafpFractal,mandelfp_per_pixel, MandelfpSetup, StandardFractal, STDBAILOUT,
  172.  
  173.    "*newton", newtdegree, ES, ES,ES,3,0,0,0,
  174.    HT_NEWT, HF_NEWT, WINFRAC,
  175.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, MPNEWTON,    XAXIS,
  176.    NewtonFractal2, otherjuliafp_per_pixel,  NewtonSetup, StandardFractal,NOBAILOUT,
  177.  
  178.    "*julia",     realparm, imagparm,ES,ES,0.3,0.6,0,0,
  179.    HT_JULIA, HF_JULIA, WINFRAC+OKJB,
  180.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, MANDELFP, JULIA,  ORIGIN,
  181.    JuliafpFractal, juliafp_per_pixel,  JuliafpSetup, StandardFractal,STDBAILOUT,
  182.  
  183.    "plasma",      "Graininess Factor (.1 to 50, default is 2)",
  184.                   "+Algorithm (0 = original, 1 = new)",
  185.                   "+Random Seed Value (0 = Random, 1 = Reuse Last)",
  186.                   "+Save as Pot File? (0 = No,     1 = Yes)",
  187.                   2,0,0,0,
  188.    HT_PLASMA, HF_PLASMA, NOZOOM+NOGUESS+NOTRACE+NORESUME+WINFRAC,
  189.    -2.0,  2.0, -1.5,  1.5, 1, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  190.    NULL,       NULL,   StandaloneSetup,     plasma,      NOBAILOUT,
  191.  
  192.    "*mandelfn",  realz0, imagz0,ES,ES,0,0,0,0,
  193.    HT_MANDFN, HF_MANDFN, TRIG1+WINFRAC,
  194.    -8.0,  8.0, -6.0,  6.0, 0, LAMBDATRIGFP,NOFRACTAL, MANDELTRIG, XYAXIS_NOPARM,
  195.    LambdaTrigfpFractal,othermandelfp_per_pixel,MandelTrigSetup,StandardFractal,LTRIGBAILOUT,
  196.  
  197.    "*manowar",    realz0, imagz0,ES,ES,0,0,0,0,
  198.    HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
  199.    -2.5,  1.5, -1.5,  1.5, 0, MANOWARJFP, NOFRACTAL, MANOWAR,  XAXIS_NOPARM,
  200.    ManOWarfpFractal,mandelfp_per_pixel, MandelfpSetup,StandardFractal,STDBAILOUT,
  201.  
  202.    "manowar",    realz0, imagz0,ES,ES,0,0,0,0,
  203.    HT_SCOTSKIN, HF_MANOWAR, WINFRAC,
  204.    -2.5,  1.5, -1.5,  1.5, 1, MANOWARJ, NOFRACTAL, MANOWARFP, XAXIS_NOPARM,
  205.    ManOWarFractal,mandel_per_pixel, MandellongSetup,StandardFractal,STDBAILOUT,
  206.  
  207.    "test","(testpt Param #1)","(testpt param #2)","(testpt param #3)","(testpt param #4)",0,0,0,0,
  208.    HT_TEST, HF_TEST, 0,
  209.    -2.0,  2.0, -1.5,  1.5, 0, NOFRACTAL, NOFRACTAL, NOFRACTAL,     NOSYM,
  210.    NULL,      NULL,         StandaloneSetup, test,    STDBAILOUT,
  211.  
  212.    "sierpinski",  ES,ES,ES,ES,0,0,0,0,
  213.    HT_SIER, HF_SIER, WINFRAC,
  214.    -0.9,  1.7, -0.9,  1.7, 1, NOFRACTAL, NOFRACTAL, SIERPINSKIFP,   NOSYM,
  215.    SierpinskiFractal,long_julia_per_pixel, SierpinskiSetup,StandardFractal,127.0,
  216.  
  217.    "barnsleym1",  realz0, imagz0,ES,ES,0,0,0,0,
  218.    HT_BARNS, HF_BARNSM1, WINFRAC,
  219.    -2.0,  2.0, -1.5,  1.5, 1, BARNSLEYJ1,NOFRACTAL, BARNSLEYM1FP,  XYAXIS_NOPARM,
  220.    Barnsley1Fractal,long_mandel_per_pixel,MandellongSetup,StandardFractal,STDBAILOUT,
  221.  
  222.    "barnsleyj1",  realparm, imagparm,ES,ES,0.6,1.1,0,0,
  223.    HT_BARNS, HF_BARNSJ1, WINFRAC+OKJB,
  224.    -2.